<template>
	<view>
		<view class="blank"></view>
		<view class="flexItem " @click="toSave">
			<view class="flexItemMain ">
				<image class="flexItemLeftImg" src="../../static/pages/set/account.png" mode=""></image>
				<view class="flexItemCenter">
					账户与安全
				</view>

				<image src="../../static/pages/int.png" class="flexItemRightImg" mode=""></image>
			</view>
		</view>
		<view class="flexItem " @click="toYinsi">
			<view class="flexItemMain ">
				<image class="flexItemLeftImg" src="../../static/pages/set/privacy.png" mode=""></image>
				<view class="flexItemCenter">
					隐私设置
				</view>

				<image src="../../static/pages/int.png" class="flexItemRightImg" mode=""></image>
			</view>
		</view>
		<!-- <view class="flexItem ">
			<view class="flexItemMain ">
				<image class="flexItemLeftImg" src="../../static/pages/set/inform.png" mode=""></image>
				<view class="flexItemCenter">
					通知设置
				</view>
		
				<image src="../../static/pages/int.png" class="flexItemRightImg" mode=""></image>
			</view>
		</view> -->
		<!-- <view class="flexItem ">
			<view class="flexItemMain ">
				<image class="flexItemLeftImg" src="../../static/pages/set/user.png" mode=""></image>
				<view class="flexItemCenter">
					用户协议
				</view>
		
				<image src="../../static/pages/int.png" class="flexItemRightImg" mode=""></image>
			</view>
		</view> -->
		<view class="flexItem ">
			<view class="flexItemMain " @click="toPolicy">
				<image class="flexItemLeftImg" src="../../static/pages/set/copy.png" mode=""></image>
				<view class="flexItemCenter">
					隐私政策
				</view>

				<image src="../../static/pages/int.png" class="flexItemRightImg" mode=""></image>
			</view>
		</view>
		<view class="flexItem ">
			<view class="flexItemMain " @click="toAbout">
				<image class="flexItemLeftImg" src="../../static/pages/set/about.png" mode=""></image>
				<view class="flexItemCenter">
					关于
				</view>

				<image src="../../static/pages/int.png" class="flexItemRightImg" mode=""></image>
			</view>
		</view>
		<view class="flexItem ">
			<view class="flexItemMain " @click="toClear">
				<image class="flexItemLeftImg" src="../../static/pages/set/del.png" mode=""></image>
				<view class="flexItemCenter">
					清除缓存空间
				</view>
				<!-- <view class="text">
					2.12MB
				</view> -->
				<image src="../../static/pages/int.png" class="flexItemRightImg" mode=""></image>
			</view>
		</view>
		<view>
			<image class="logout" @click="logout" src="../../static/pages/set/logout.png"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		methods: {
			toYinsi() {
				uni.navigateTo({
					url: '/pages/my/yinsi'
				})
			},
			toSave() {
				uni.navigateTo({
					url: '/pages/my/save'
				})
			},
			toAbout() {
				uni.navigateTo({
					url: '/pages/my/about'
				})
			},
			logout() {
				uni.showModal({
					title: '退出登录',
					    content: '是否退出登录',
					    success: function (res) {
					        if (res.confirm) {
					           uni.clearStorageSync();
					           uni.navigateTo({
					           	url: '/pages/login/login'
					           })
							   this.tim.logout();
					        } 
					    }
				})

			},
			toPolicy() {
				uni.navigateTo({
					url: '/pages/login/policy'
				})
			},
			toClear() {
				uni.showModal({
					title: '清除缓存',
					content: "是否清除",
					success: (showResult) => {
						if (showResult.confirm) {
							uni.showToast({
								title: '清除成功'
							})
						}
					}
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}

	.blank {
		width: 100%;
		height: 2rpx;
		background: #e5e6f6;
	}

	.flexItemMain {
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 30rpx 0;
	}

	.flexItemLeft {
		flex: none;
		border-radius: 100%;
		overflow: hidden;
		width: 60rpx;
		height: 60rpx;
		margin-left: 30rpx;
		margin-right: 27rpx;
	}

	.flexItemLeftImg {
		width: 36rpx;
		height: 36rpx;
		flex: none;
		margin-right: 30rpx;
		margin-left: 30rpx;
	}

	.flexItemCenter {
		flex: auto;
		text-align: left;
	}

	.flexItemRightImg {
		width: 24rpx;
		height: 24rpx;
		flex: none;
		margin-right: 30rpx;
		margin-left: 10rpx;
	}

	.text {
		font-size: 27rpx;
	}

	.logout {
		margin: 50rpx 0rpx 0rpx 34rpx;
		width: 683rpx;
		height: 100rpx;
	}
</style>
